//
//  ZYUnknowDecoder.m
//  ZYWebImage
//
//  Created by wangzhipan on 2025/3/6.
//

#import "ZYUnknowDecoder.h"

@interface ZYUnknowDecoder() {
    NSData *_data;
}

@end

@implementation ZYUnknowDecoder
- (instancetype)initWithData:(NSData *)data
{
    if (self = [super init]) {
        _data = data;
    }
    return self;
}

- (UIImage *)decodeImage
{
    NSData *data = _data;
    if (!data || data.length == 0) {
        return nil;
    }
    CGFloat scale = MAX(1, [UIScreen mainScreen].scale);
    return [UIImage imageWithData:data scale:scale];
}
@end
